# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-wireless/rtl8180/rtl8180-0.22_pre20050528.ebuild,v 1.3 2006/06/25 17:19:44 genstef Exp $

inherit linux-mod eutils

DESCRIPTION="Driver for the rtl8180 wireless chipset"
HOMEPAGE="http://rtl8180-sa2400.sourceforge.net"

FNAME="download.php?group_id=114161&atid=667396&file_id=215365&aid=1656996"
SRC_URI="http://sourceforge.net/tracker/rtl8180-0.22_pre20070210.tar.bz2"

LICENSE="GPL-2"

KEYWORDS="~x86 ~ppc"
IUSE=""

DEPEND="net-wireless/wireless-tools"

MODULE_NAMES="ieee80211-rtl(net:) r8180(net:)"
CONFIG_CHECK="NET_RADIO CRYPTO CRYPTO_ARC4 CRC32"
BUILD_TARGETS="all"

RESTRICT="fetch"

pkg_nofetch() {
	[ -f "${DISTDIR}/${P}" ] && return
	einfo "Please download this file:"
	einfo "http://sourceforge.net/tracker/${FNAME}"
	einfo "then rename it to '${P}.tar.bz2' and place it"
	einfo "into ${DISTDIR}"
}

pkg_setup() {
        if kernel_is lt 2 6 20; then
		eerror "${P} requires kernel 2.6.20 or above."
		die "Kernel version too old."
	fi
										
	linux-mod_pkg_setup
	BUILD_PARAMS="KSRC=${KV_DIR}"
}

src_unpack() {
	unpack ${A}
	cd ${S}
}

src_install() {
	linux-mod_src_install

	dodoc AUTHORS CHANGES INSTALL README README.adhoc
}
